package com.ky.gp.app.controller;


import com.baomidou.mybatisplus.extension.api.R;
import com.ky.common.param.CircleArticleAdd;
import com.ky.gp.app.service.CircleArticleFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

;


/**
 * <p>
 * 文章表 前端控制器
 * </p>
 *
 * @author lcr
 * @since 2024-06-17
 */
@RestController
@RequestMapping("/api/circle")
public class CircleArticleController {


    @Autowired
    private CircleArticleFeign circleArticleFeign;


    @RequestMapping("/selectAll")
    public R selectArticleList(){
        return circleArticleFeign.selectAll();

    }


    @RequestMapping("/selectTypeId")
    public R selectTypeId(){
        return circleArticleFeign.selectTypeId();

    }

    @RequestMapping("/addCircleArticle")
    public R addCircleArticle(@RequestBody CircleArticleAdd circleArticleAdd){

        return circleArticleFeign.addCircleArticle(circleArticleAdd);

    }

    @RequestMapping("/selectById/{id}")
    public R selectById(@PathVariable("id") Integer id){
        return circleArticleFeign.selectById(id);

    }



    @RequestMapping("/addPraises/{id}")
    public R addPraises(@PathVariable("id") int id){
        return circleArticleFeign.addPraises(id);

    }


    @RequestMapping("/addCollect/{id}")
    public R addCollect(@PathVariable("id") int id){
        return circleArticleFeign.addCollect(id);

    }

    @RequestMapping("/addReview")
    public R addReview(int id){
        return circleArticleFeign.addReview(id);

    }

    @RequestMapping("/praises/{id}/praises")
    public R praises(@PathVariable int id){
        return circleArticleFeign.praises(id);

    }


    @RequestMapping("/collect/{id}/collect")
    public R collect(@PathVariable int id){
        return circleArticleFeign.collect(id);

    }

}

